package com.mall.user.service;

import com.auth0.jwt.JWT;
import com.auth0.jwt.algorithms.Algorithm;
import com.mall.entity.TbUser;
import org.springframework.stereotype.Service;

@Service
public class TokenService {

    public String getToken(TbUser user) {
        String token="";
        token= JWT.create().withAudience(user.getTel())
                .sign(Algorithm.HMAC256(user.getPwd()));
        return token;
    }

}
